package cn.darkhorse.workflow.tool;

/**
 * @description:
 * @author: mr.wang
 * @time: 2024/1/4 8:54
 */
public class BusinessConstants {
	
	
	/**
	 * 表示数据审核状态
	 */
	public static String FIELDNAME_AUDIT_STATUS = "audit_status";
	public static String FIELDNAME_CODE = "code";
	public static String FIELDNAME_NAME = "name";
	
	
	/** 下划线 */
	private static final char SEPARATOR = '_';
	
	/**
	 * 待审
	 */
	public final static Integer AUDIT_STATUS_PENDING_TRIAL = 0;
	/**
	 * 审核中
	 */
	public final static Integer AUDIT_STATUS_UNDER_REVIEW = 2;
	
	/**
	 * 已审
	 */
	public final static Integer AUDIT_STATUS_REVIEWED = 1;
	
	
	
	
	
	
	
	/**
	 * 驼峰式命名法 例如：user_name->userName
	 */
	public static String toCamelCase(String s)
	{
		if (s == null)
		{
			return null;
		}
		s = s.toLowerCase();
		StringBuilder sb = new StringBuilder(s.length());
		boolean upperCase = false;
		for (int i = 0; i < s.length(); i++)
		{
			char c = s.charAt(i);
			
			if (c == SEPARATOR)
			{
				upperCase = true;
			}
			else if (upperCase)
			{
				sb.append(Character.toUpperCase(c));
				upperCase = false;
			}
			else
			{
				sb.append(c);
			}
		}
		return sb.toString();
	}
	
}
